package com.baizhi.lqy.controller;

import com.baizhi.lqy.entity.User;
import com.baizhi.lqy.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserServiceImpl userServiceImpl;

    //分页查询
    @ResponseBody
    @CrossOrigin
    @RequestMapping("/queryAllPage")
    public Map<String, Object> queryAllPage(int page, int pageSize){
        return userServiceImpl.queryAllPage(page,pageSize);
    }

    //修改状态
    @ResponseBody
    @CrossOrigin
    @RequestMapping("/update")
    public Map<String, Object> update(@RequestBody User user){
        return userServiceImpl.update(user);
    }

}
